<include file="Public:_header" />
<script type="text/javascript" src="weixin_statics/js/year_month_day.js"></script>
<script src="weixin_statics/js/jquery.easydropdown.js" type="text/javascript"></script>
<style>
.pro,.city,.area{
position: relative;
width: 30%;
height:36px;
cursor: pointer;
font-weight: 200;
background: #f8f8f8;
-webkit-user-select: none;
-moz-user-select: none;
user-select: none;border:0px;
}
.hpro,.hcity{
position: relative;
width: 49%;
height:36px;
cursor: pointer;
font-weight: 200;
background: #f8f8f8;
-webkit-user-select: none;
-moz-user-select: none;
user-select: none;border:0px;
}
</style>
<script language="javascript">
        function submit()
        {
           var flag=true;
            if($("#name").val()==""||$("#name").val().length>20)
            {
                $("#name").addClass("red");
                flag = false;
            }else{
                $("#name").removeClass("red");
            }
            if($("#phone").val()=="")
            {
                $("#phone").addClass("red");
                flag=false;
            }else{
             var phone = $("#phone").val();
             var reg = /^0?1[3|4|5|8][0-9]\d{8}$/;
             if (reg.test(phone)) {
                $("#phone").removeClass("red");   
              }else{
                 $("#phone").addClass("red");
                  flag=false;
              }
             
            }
            if($.trim($("#shengao").val())=="")
            {
                $("#shengao").addClass("red");
                flag=false;
            }else{
                $("#shengao").removeClass("red");
            }
            if($.trim($("#tizhong").val())=="")
            {
                $("#tizhong").addClass("red");
                flag=false;
            }else{
              $("#tizhong").removeClass("red");
            }
            if(flag==true)
            {
                $("#subform").submit();
            }
             
        }

        $(document).ready(function(){
            $(".pro").change(function(){
      
                pro = $(this).val();
                $.post('__URL__/getarea',{type:'city',aid:pro},function(res){
                  $(".city option").remove();
                  $(".city").append("<option value='0'>市</option>");
                  for(i=0;i<res.length;i++){
                    $(".city").append("<option value='"+res[i]['area_id']+"'>"+res[i]['title']+"</option>");
                  }
                  //alert(res);
                },'json');
    });
    $(".city").change(function(){
      city = $(this).val();
      $.post('__URL__/getarea',{type:'area',aid:city},function(res){
        $(".area option").remove();
        $(".area").append("<option value='0'>区</option>");
        for(i=0;i<res.length;i++){
          $(".area").append("<option value='"+res[i]['area_id']+"'>"+res[i]['title']+"</option>");
        }
        //alert(res);
      },'json');
    });
   $(".hpro").change(function(){
      pro = $(this).val();
      $.post('__URL__/getarea',{type:'city',aid:pro},function(res){
        $(".hcity option").remove();
        $(".hcity").append("<option value='0'>市</option>");
        for(i=0;i<res.length;i++){
          $(".hcity").append("<option value='"+res[i]['area_id']+"'>"+res[i]['title']+"</option>");
        }
        //alert(res);
      },'json');
    });
  $(".sex").find("label").each(function(index){
      $(".sex").find("label").eq(index).bind("click",function(){
                if(index==1)
                   {
                      $("#sex").attr('value',index);
                       $(".sex").find("label").eq(1).find("img").attr("src","weixin_statics/images/sex12.png");
                       $(".sex").find("label").eq(2).find("img").attr("src","weixin_statics/images/sex21.png");
                       
                   }else if(index==2){
                     $("#sex").attr('value',index);
                        $(".sex").find("label").eq(1).find("img").attr("src","weixin_statics/images/sex11.png");
                        $(".sex").find("label").eq(2).find("img").attr("src","weixin_statics/images/sex22.png");
                   }
                   
                });
            });
    
  


            var clickEventType=((document.ontouchstart!==null)?'click':'touchstart');
            var y = "{$info.sheng1}";
            var m = "{$info.sheng2}";
            var d = "{$info.sheng3}";
            //初始化年月日
            var e = "{$Think.get.edit}";
            if(e == 1){
              new YMDselect('year','month','day',y,m,d);
            }else{
              new YMDselect('year','month','day',1990,2,10);
            }
            

            $("#name").on("focus",function(){
                $(this).removeClass("red");
            });
            $("#name").on("blur",function(){
                if($.trim($(this).val())==""||$.trim($(this).val()).length>20)
                {
                    $(this).addClass("red");
                }
            });




            $('#year').easyDropDown({
                cutOff: 10,
                wrapperClass: 'dropdown',
                onChange: function(selected) {
                    $("#month").easyDropDown("destroy");
                    $("#month").easyDropDown({
                        cutOff: 10,
                        wrapperClass: 'dropdown',
                        onChange: function (selected) {

                        }
                    });
                }
            });

            $('#month').easyDropDown({
                cutOff: 10,
                wrapperClass: 'dropdown',
                onChange: function(selected) {
                    $("#day").easyDropDown("destroy");
                    $("#day").easyDropDown({
                        cutOff: 10,
                        wrapperClass: 'dropdown',
                        onChange: function (selected) {

                        }
                    });
                }
            });

            

      });
    </script>
<div class="warp">
    	<h2 class="ztitle">基本资料</h2>
      <form action="__URL__/add_member_info" method="post" id="subform">
        <ul class="zllist">
          <li><i class="txt">姓名：</i><input type="" class="text" id="name"  name="truename" value="{$info.truename}"></li>
          <li class="sex"><i class="txt">性别：</i>
              <label>
                <eq name="info.xingbie" value="2">
                  <input type="hidden" name="xingbie" id="sex" value="2">
                  <else/>
                 <input type="hidden" name="xingbie" id="sex" value="1">
               </eq>
              <label>
              <eq name="info.xingbie" value="1">
              <img src="weixin_statics/images/sex12.png" alt="">
              <else/>
              <img src="weixin_statics/images/sex11.png" alt="">
              </eq>
                男</label>
              <label>
                <eq name="info.xingbie" value="2">
                  <img src="weixin_statics/images/sex22.png" alt="">
                <else/>
                <img src="weixin_statics/images/sex21.png" alt="">
              </eq>
                女</label>
            </li>
          <li><i class="txt">手机：</i><input type="" name="phone" id="phone" class="text" value="{$info.phone}"></li>
          <li><i class="txt">身高：</i><input type="" name="shengao" id="shengao" class="text" value="{$info.shengao}" placeholder="厘米" style="width:50%;"> CM</li>
          <li><i class="txt">体重：</i><input type="" value="{$info.tizhong}" name="tizhong" id="tizhong" class="text" placeholder="公斤" style="width:50%;"> Kg</li>
          <li><i class="txt">婚姻：</i>
              <label>
                <input type="radio" name="hunyin" value="1" id="" checked>
                未婚</label>
              <label>
                <input type="radio" name="hunyin" value="2" id="">
                已婚</label>
              <label>
                <input type="radio" name="hunyin" value="3" id="">
                已婚已育</label>
          </li>
          <script>
          var val = "{$info.hunyin}";
          $("input[name='hunyin'][value="+val+"]").attr("checked",true);
          </script>
          <li class="birth"><i class="txt">生日：</i>
            <select  class="dropdown" tabindex="1" id="year" name="year" style="width:31%;"></select>
          <select tabindex="2" class="dropdown"  id="month" name="month" style="width:31%;"></select>
          <select tabindex="3" class="dropdown"  id="day" name="day" style="width:31%;"></select>
          </li>
          <li class="deg"><i class="txt">学历：</i>
            <select name="xueli" class="dropdown"> 
              <volist name="xueli" id="xo">
                <eq name="xo.eid" value="$info.xueli">
                <option value="{$xo.eid}" selected>{$xo.edu}</option>
                <else/>
                <option value="{$xo.eid}">{$xo.edu}</option>
                </eq>
              </volist>
            </select>
          </li>
          <li class="reg"><i class="txt">现居：</i>
            <select name="pro" class="pro" id="pro">
                <option value="0" >省</option>
                <volist name="pro" id="p">
                  <eq name="p.area_id" value="$info.pro">
                <option  value="{$p.area_id}" selected>{$p.title}</option>
                <else/>
                <option  value="{$p.area_id}">{$p.title}</option>
                </eq>
                </volist>
              </select>
              <select name="city" class="drop city " id="city">
                <eq name="Think.get.edit" value="1">
                <empty name="incity">
                <option value="0">市</option>
                <else/>
                  <volist name="incity" id="co">
                    <eq name="co.area_id" value="$info.city">
                      <option value="{$co.area_id}" selected>{$co.title}</option>
                      <else/>
                      <option value="{$co.area_id}">{$co.title}</option>
                    </eq>
                  </volist>
                </empty>
                <else/>
                <option value="0">市</option>
                </eq>
              </select>
              <select name="area" class="drop area " id='area '>
                <eq name="Think.get.edit" value="1">
                <empty name="incity">
                <option value="0">区</option>
                <else/>
                  <volist name="inarea" id="co">
                    <eq name="co.area_id" value="$info.area">
                      <option value="{$co.area_id}" selected>{$co.title}</option>
                      <else/>
                      <option value="{$co.area_id}">{$co.title}</option>
                    </eq>
                  </volist>
                </empty>
                <else/>
                <option value="0">区</option>
              </eq>
              </select>
          </li>
          <li class="reg"><i class="txt">户籍：</i>
            <select name="hpro" class="hpro" id="hpro" style="">
                <option value="0" style="">省</option>
                <volist name="pro" id="p">
                  <eq name="p.area_id" value="$info.hpro">
                    <option  value="{$p.area_id}" selected>{$p.title}</option>
                  <else/>
                    <option  value="{$p.area_id}">{$p.title}</option>
                  </eq>
                </volist>
              </select>
              <select name="hcity" class="drop hcity" id="hcity">
                <empty name="inhcity">
                <option value="0">市</option>
                <else/>
                  <volist name="inhcity" id="co">
                    <eq name="co.area_id" value="$info.hcity">
                      <option value="{$co.area_id}" selected>{$co.title}</option>
                      <else/>
                      <option value="{$co.area_id}">{$co.title}</option>
                    </eq>
                  </volist>
                </empty>
              </select></li>
          
        </ul>
        <input name="edit" type="hidden" value="{$Think.get.edit}">
        <a class="submit " href="javascript:submit();" style="width:200px;">保存</a>
      </form>
      <notempty name="Think.get.edit">
      <a class="submit add" href="__ROOT__/weixin.php?s=/Resume/resume_02/edit/1" style="width:200px;">修改求职意向和工作年限</a>
      <a class="submit add" href="__ROOT__/weixin.php?s=/Resume/edit_exper" style="width:200px;">添加或修改工作经历</a>
      <a class="submit add" href="__ROOT__/weixin.php?s=/Resume/resume_04/edit/1" style="width:200px;">修改自我介绍</a>
    </notempty>
    </div>
    </body>
</html>